#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include "chemnitz.h"
#include "chemnitz_stream.h"

int main (void)
{
	uint8_t k [16];
	uint8_t b [1024];
	int i;
	CHEMNITZ_STREAM str;

	memcpy (k, "this is a secret", 16);

	str = chemnitz_stream_open (k, 45);
	for (i = 0; i < 1000; i ++)
	{
		if (chemnitz_stream_is_open (str))
		{
			(void) chemnitz_stream_read (str, b, 1024);
			(void) write (1, b, 1024);
		}
	}
	chemnitz_stream_close (str);

	return 0;
}

